package com.rede.didiok.sms.restapi;

import javax.annotation.Resource;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rede.didiok.common.feign.AdminFeignClient;
import com.rede.didiok.common.feign.UserFeignClient;

/**
 * 用于feign操作的接口，只允许服务内部调用
 */

@RestController
@RequestMapping("/smsFeign")
@Slf4j
public class SmsFeignRestApi {

    @Resource
    private UserFeignClient userFeignClient;
    @Resource
    private AdminFeignClient adminFeignClient;


//
//    @FeignSecurity
//    @ApiOperation(value = "获取用户列表", notes = "获取用户列表")
//    @PostMapping("/getUserListByPage")
//    public List<UserDto> getUserListByPage(@RequestBody UserDto userVO) {
//        log.info("获取用户列表");
//        IPage<User> userIPage = userService.getPageList(userVO);
//        return userService.convertUserList(userIPage.getRecords());
//    }
//
//    @FeignSecurity
//    @ApiOperation(value = "获取管理员列表", notes = "获取用户列表")
//    @PostMapping("/getAdminListByPage")
//    public List<Admin> getAdminListByPage(@RequestBody AdminVO adminVO) {
//        log.info("获取用户列表");
//        return adminService.getAdminListByUid(adminVO.getAdminUidList());
//    }
//
//    @FeignSecurity
//    @ApiOperation(value = "获取用户钱包金额", notes = "获取用户钱包金额")
//    @PostMapping("/getUserAmount")
//    public String getUserAmount(@ApiParam(name = "userUid", value = "钱包余额消耗", required = true) @RequestParam(name = "userUid", required = true) String userUid) {
//        log.info("获取用户钱包金额");
//        return ResultUtil.successWithData(userService.getUserAmount(userUid));
//    }
//
//
//    /**
//     * 更新用户钱包余额
//     * @param userUid
//     * @param amount
//     * @return
//     */
//    @FeignSecurity
//    @ApiOperation(value = "更新用户钱包余额", notes = "更新用户钱包余额")
//    @PostMapping("/updateAmountByUserUid")
//    public String updateAmountByUserUid(@ApiParam(name = "userUid", value = "钱包余额消耗", required = true) @RequestParam(name = "userUid", required = true) String userUid,
//                                        @ApiParam(name = "amount", value = "钱包余额消耗", required = true) @RequestParam(name = "amount", required = true, defaultValue = "0") Long amount) {
//        log.info("消耗钱包账户余额");
//        userService.updateAmountByUserUid(userUid, amount);
//        return ResultUtil.successWithMessage("更新用户余额成功");
//    }


//    @FeignSecurity
//    @ApiOperation(value = "获取文本答案", notes = "获取文本答案")
//    @PostMapping("/getTextAnswer")
//    public String getTextAnswer(@ApiParam(name = "question", value = "问题", required = true) @RequestParam(name = "question", required = true) String question) {
//        log.info("[getTextAnswer] 获取文本答案, question: {}", question);
//        return languageModelService.getTextAnswer(question);
//    }

}
